package com.zhongya.example.view

import android.content.Context
import android.graphics.*
import android.os.Build
import android.util.AttributeSet
import android.view.View
import androidx.annotation.RequiresApi

class MatrixSaveFlagView : View {

    val mPaint = Paint()

    constructor(context: Context) : super(context) {

    }

    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        setLayerType(LAYER_TYPE_SOFTWARE, null)
        mPaint.color=Color.GRAY
   }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)

        /*canvas?.save()
        canvas?.rotate(45f)
        canvas?.drawRect(100f,0f,200f,100f,mPaint)
        canvas?.restore()
        mPaint.color=Color.BLACK
        canvas?.drawRect(100f,0f,200f,100f,mPaint)*/


        /*canvas?.save()
        canvas?.clipRect(100f,0f,200f,100f)
        canvas?.drawColor(Color.GRAY)
        canvas?.restore()
        mPaint.color=Color.BLACK
        canvas?.drawColor(Color.BLACK)*/

        /*mPaint.color = Color.GRAY
        canvas?.drawRect(100f,0f,200f,100f,mPaint)
        canvas?.save()
        canvas?.rotate(40f)
        canvas?.restore()
        mPaint.color = Color.BLACK
        canvas?.drawRect(100f,0f,200f,100f,mPaint)*/


    }
}